<!-- 社保编辑 -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->
<!--      -->

<template>
    <el-dialog
        v-model="props.sheBao"
        title="社保编辑"
        @close="close"
        destroy-on-close
        width="70%"
    >
        <el-form
            :inline="true"
            :model="props.bianjichuancan"
            label-position="left"
            label-width="110px"
            style="margin-top: 8px"
        >
            <a-row>
                <!-- <a-col :span="6"
                    ><el-form-item label="业务中心" prop="business">
                        <el-select
                            v-model="props.bianjichuancan.business"
                            placeholder="请选择业务中心"
                            clearable
                            style="width: 180px"
                            @change="handleSelectChange"
                        >
                            <el-option
                                v-for="item in props.yewu"
                                :key="item.dictValue"
                                :label="item.dictLabel"
                                :value="item.dictValue"
                        /></el-select> </el-form-item
                ></a-col> -->
                <!-- <a-col :span="6"
                    ><el-form-item
                        label="班&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;组"
                        prop="team"
                    >
                        <el-select
                            v-model="props.bianjichuancan.team"
                            placeholder="请选择班组"
                            clearable
                            style="width: 180px"
                        >
                            <el-option
                                v-for="item in banzu"
                                :key="item.teamValue"
                                :label="item.teamLabel"
                                :value="item.teamValue"
                        /></el-select> </el-form-item
                ></a-col> -->
                <a-col :span="6">
                    <el-form-item label="lecc账号" prop="leccAccount">
                        <el-input
                            v-model="props.bianjichuancan.leccAccount"
                            placeholder="请输入员工账号"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item
                        label="姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名"
                        prop="userName"
                    >
                        <el-input
                            v-model="props.bianjichuancan.userName"
                            placeholder="请输入员工姓名"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item
                        label="岗&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位"
                        prop="job"
                    >
                        <el-select
                            v-model="props.bianjichuancan.job"
                            placeholder="请选择岗位"
                            clearable
                            style="width: 180px"
                            @keyup.enter="handleQuery"
                        >
                            <el-option
                                v-for="item in props.gangwei"
                                :key="item.dictLabel"
                                :label="item.dictLabel"
                                :value="item.dictValue"
                        /></el-select> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item label="社保月份" prop="month">
                        <el-input
                            v-model="props.bianjichuancan.month"
                            placeholder="请输入社保月份"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item label="身份证号" prop="identityCard">
                        <el-input
                            v-model="props.bianjichuancan.identityCard"
                            placeholder="请输入身份证号"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item
                        label="社保缴纳基数"
                        prop="socialSecurityBase"
                    >
                        <el-input
                            v-model="props.bianjichuancan.socialSecurityBase"
                            placeholder="请输入社保缴纳基数"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item
                        label="公积金缴纳基数"
                        prop="accumulationFundBase"
                    >
                        <el-input
                            v-model="props.bianjichuancan.accumulationFundBase"
                            placeholder="请输入公积金缴纳基数"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="6">
                    <el-form-item label="公司承担额" prop="companyMoney">
                        <el-input
                            v-model="props.bianjichuancan.companyMoney"
                            placeholder="请输入公司承担额"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
            </a-row>
            <br />
            <a-row>
                <a-col :span="24">
                    <el-form-item label="公司承担额明细" prop="companyMoney">
                    </el-form-item
                ></a-col>
                <br />
                <a-col :span="24">
                    <el-form-item label="养老（16%）" prop="companyProvideAged">
                        <el-input
                            v-model="props.bianjichuancan.companyProvideAged"
                            placeholder="请输入养老比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label="	医保（8%）"
                        prop="companyMedicalTreatment"
                    >
                        <el-input
                            v-model="
                                props.bianjichuancan.companyMedicalTreatment
                            "
                            placeholder="请输入医保比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label="工伤（0.2%）"
                        prop="companyOccupationalInjury"
                    >
                        <el-input
                            v-model="
                                props.bianjichuancan.companyOccupationalInjury
                            "
                            placeholder="请输入工伤比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item label="失业（0.7%）" prop="companyLoseJob">
                        <el-input
                            v-model="props.bianjichuancan.companyLoseJob"
                            placeholder="请输入失业比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label="公积金（5%）"
                        prop="companyAccumulationFund"
                    >
                        <el-input
                            v-model="
                                props.bianjichuancan.companyAccumulationFund
                            "
                            placeholder="请输入公积金比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <br />
                <a-col :span="6">
                    <el-form-item label="个人承担额" prop="personalMoney">
                        <el-input
                            v-model="props.bianjichuancan.personalMoney"
                            placeholder="请输入个人承担额"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <br />
                <a-col :span="24">
                    <el-form-item label="个人承担额明细" prop="companyMoney">
                    </el-form-item
                ></a-col>
                <br />
                <a-col :span="24">
                    <el-form-item
                        label="养老个人(8%)"
                        prop="personalProvideAged"
                        label-width="110px"
                    >
                        <el-input
                            v-model="props.bianjichuancan.personalProvideAged"
                            placeholder="请输入养老比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label-width="110px"
                        label="医疗个人(2%)"
                        prop="personalMedicalTreatment"
                    >
                        <el-input
                            v-model="
                                props.bianjichuancan.personalMedicalTreatment
                            "
                            placeholder="请输入医疗比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label-width="110px"
                        label="失业个人(0.3%)"
                        prop="personalLoseJob"
                    >
                        <el-input
                            v-model="props.bianjichuancan.personalLoseJob"
                            placeholder="请输入失业比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
                <a-col :span="24">
                    <el-form-item
                        label-width="115px"
                        label="公积金个人(5%)"
                        prop="personalAccumulationFund"
                    >
                        <el-input
                            v-model="
                                props.bianjichuancan.personalAccumulationFund
                            "
                            placeholder="请输入公积金比例"
                            clearable
                            style="width: 180px"
                        /> </el-form-item
                ></a-col>
            </a-row>
        </el-form>
        <template #footer>
            <span class="dialog-footer">
                <el-button color="#3175BE" @click="saveRow"> 保存 </el-button>
                <el-button color="#CC3339" @click="close">取消</el-button>
            </span>
        </template>
    </el-dialog>
</template>
<script setup>
import { watch, ref } from 'vue';
import { getBanzu } from '@/api/socialSecurity/index';
const props = defineProps({
    sheBao: Boolean,
    bianjichuancan: Object,
    yewu: Array,
    gangwei: Array,
});
const banzu = ref([]);
const handleSelectChange = (value) => {
    if (value) {
        var params = {
            businessValue: value,
        };
        //班组
        getBanzu(params).then((res) => {
            console.log(res.data);
            banzu.value = res.data;
        });
    } else {
        banzu.value = [];
    }
};
const emit = defineEmits(['searchBtn', 'saveRow', 'close']);
//保存
const saveRow = () => {
    emit('saveRow', props.bianjichuancan);
};

//取消
const close = () => {
    emit('close');
};
</script>
<style></style>
